#!/usr/bin/env python

def build(bld):
	lib = bld.create_obj('cc', 'staticlib')
	lib.uselib = 'GLIB GOBJECT GIO'
	lib.packages = 'gio-2.0'
	lib.find_sources_in_dirs('.')
	lib.target = 'gnio'
	lib.includes = '..'
	sources = [source.replace('.c', '.h') for source in lib.source if lib.path.find_resource(source.replace('.c', '.h'))]
	lib.add_glib_mkenum(source=sources, template='gnioenums.c.template', target='gnioenums.c')
	lib.add_glib_mkenum(source=sources, template='gnioenums.h.template', target='gnioenums.h')
